import os

from aiogram import Bot
from aiogram.contrib.fsm_storage.memory import MemoryStorage
from aiogram.dispatcher import Dispatcher


from aiogram.contrib.fsm_storage.redis import RedisStorage2

from config import load_config

BASE_DIR = os.path.dirname(os.path.realpath(__file__))

config = load_config()

storage = RedisStorage2() if config.tg_bot.use_redis else MemoryStorage()
bot = Bot(token=config.tg_bot.token, parse_mode="HTML")
dp = Dispatcher(bot=bot, storage=storage)
